QuickTime 3 For Windows Programmers

| Previous | Chapter Contents | Chapter Top | Next |

QTMLGetCanonicalPathName

The QTMLGetCanonicalPathName routine takes a native file path and returns the one canonical path to that file.

OSErr QTMLGetCanonicalPathName(char *inName, char *outName,
                                          unsigned long outLen);
inName
Specifies the input path.

outName
Specifies where the routine puts the canonical path.

outLen
Specifies the length of the outName buffer, so that the routine knows not to write past the end of your buffer.

DISCUSSION

This routine takes a native file path and returns the one canonical path to that file.

Some of the tasks performed by this routine include:

For example, if you have a file with the following path

c:\Program Files\Some Product\test.mov

and the 8.3 path happens to be:

c:\PROGRA~1\SOMEPR~1\test.mov

you can pass any of the following paths to QTMLGetCanonicalPathName

c:\Some other folder\..\program FILES\another program\..\somepr~1\TeSt.MoV
C:\proGra~1\Some product\..\SOMEPR~1\..\..\program files\some product\test.mov
C:\PROGRA~1\SOMEPR~1\TEST.MOV

and it will always return

c:\Program Files\Some Product\test.mov

There is a one-to-one mapping between canonical pathnames and files. In other words, you can determine if two paths point to the same file by canonicalizing both paths, and then doing a string compare.

This routine also works for universal naming convention (UNC) paths. These paths are of the form:

\\my_server\shared_folder\another folder\test.mov

© 1998 Apple Computer, Inc.

| Previous | Chapter Contents | Chapter Top | Next |